﻿/*
 * SVN-based CodeReview
 * Copyright (c) Karim Agha <karim.dev@gmail.com>.
 */

namespace Sentio.CodeReview.Foundation
{
    using System;

    /// <summary>
    /// An entity representing a piece of comment assigned to a block of code.
    /// This entity is the most basic and fundamental entity in the whole project.
    /// </summary>
    /// <remarks>
    /// Comments are added to files by leveraging the svn properties feature, each comment
    /// is a property, with a predefined prefix, containing data in the followind format:
    /// cr:author:status:from:to   =    comment body
    /// </remarks>
    public class BlockComment
    {
        /// <summary>
        /// The username of the author.
        /// </summary>
        public string Author { get; set; }

        /// <summary>
        /// The start position of the content that this comment is concerning.
        /// </summary>
        public int FromOffset { get; set; }

        /// <summary>
        /// The end position of the content that this comment is concerning.
        /// </summary>
        public int ToOffset { get; set; }

        /// <summary>
        /// The string that is the comment itself.
        /// </summary>
        public string CommentBody { get; set; }

        /// <summary>
        /// The status of this comment.
        /// </summary>
        public BlockCommentStatus Status { get; set; }

        /// <summary>
        /// Timestamp, when the project was created.
        /// </summary>
        public DateTime CreatedAt { get; set; }
    }
}
